package com.uuj.project.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.ImageView;

import com.blankj.utilcode.constant.PermissionConstants;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.PermissionUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.bumptech.glide.Glide;
import com.uuj.project.R;
import com.uuj.project.base.BaseActivity;
import com.uuj.project.presenter.StartPresenter;
import com.uuj.project.utils.DialogHelper;
import com.uuj.project.utils.Permission;
import com.uuj.project.utils.PermissionHelper;
import com.uuj.project.utils.TimeCount;
import com.uuj.project.view.IBaseView;

import java.util.List;

import butterknife.BindView;

/**
 * ProjectName:    ok_rxjava_retrofit
 * Package:        com.uuj.project.activity
 * ClassName:      StartActivity
 * Description:    描述
 * Author:         张继
 * CreateDate:     2019/8/8 10:39
 * UpdateUser:     更新者
 * UpdateDate:     2019/8/8 10:39
 * UpdateRemark:   更新说明
 * Version:        1.0
 */
public class StartActivity extends BaseActivity<StartPresenter> implements IBaseView {
    @BindView(R.id.start_back)
    ImageView startBack;

    @Override
    protected int setContentView() {
        return R.layout.activity_start;
    }

    @Override
    protected void initData() {

        Glide.with(this).asGif().load(R.mipmap.start_gif).into(startBack);
        PermissionHelper.requestCamera(this, () -> {
            new TimeCount(1000, 1000) {
                @Override
                public void onFinish() {
                    super.onFinish();
                    ActivityUtils.startActivity(MainActivity.class);
                    finish();
                }
            }.start();
        }, shouldRequest -> {
            shouldRequest.again(true);
        });


    }

    @Override
    protected void initToolbar(Bundle savedInstanceState) {

    }

    @Override
    protected StartPresenter createPresenter() {
        return new StartPresenter(this);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Log.e("e", "e");
    }
}
